import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Point;
import java.awt.Polygon;
import java.awt.geom.Ellipse2D;
import java.awt.geom.GeneralPath;
import java.awt.geom.Rectangle2D;

import javax.swing.*;

public class Version1 
{

	public static void main(String[] args) 
	{
		SimpleFrame frame = new SimpleFrame();
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);

	}

}

class SimpleFrame extends JFrame
{
	public SimpleFrame()
	{
		setSize(600,600);
		setLocation(400,100);
		setTitle("Testing");
		
		Panel panel = new Panel();
		add(panel);
	}
}
	
class Panel extends JPanel
{
	int coordinates[][] = new int[4][4];
	
	public void paintComponent(Graphics g)
	{
		coordinates[0][0] = 50;
		coordinates[0][1] = 50;
		coordinates[1][0] = 160;
		coordinates[1][1] = 160;
		coordinates[2][0] = 270;
		coordinates[2][1] = 270;
		coordinates[3][0] = 380;
		coordinates[3][1] = 380;
		Graphics2D g2 = (Graphics2D) g;
		
		Ellipse2D circle = new Ellipse2D.Double();
		for(int i=0;i<4;i++)
		{
			circle.setFrame( coordinates[i][0], coordinates[i][1],10,10);	//Circle drawn, coordinates to be decided
			g2.fill(circle);
			g2.draw(circle);
		}
		
		Rectangle2D square = new Rectangle2D.Double(25, 25, 15, 15);		//Square drawn, coordinates to be decided
		g2.fill(square);
		g2.draw(square);
		
		int x1Points[] = {100, 150, 200};
		int y1Points[] = {100, 150, 100};
		GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, x1Points.length);
		polygon.moveTo(x1Points[0], y1Points[0]);

		for (int index = 1; index < x1Points.length; index++) {
		        polygon.lineTo(x1Points[index], y1Points[index]);	//Triangle drawn, coordinates to be decided
		};

		polygon.closePath();
		g2.fill(polygon);
		g2.draw(polygon);
	}
}